﻿<UserControl x:Class="ScrumFactory.Projects.SummaryHelp"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:props="clr-namespace:ScrumFactory.Projects.Properties"    
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    
    <StackPanel>
        
        <!-- HELPS -->
        <StackPanel>

        <ContentPresenter 
            Margin="0,0,0,10"
            Content="{Binding Source={x:Static props:Resources.HELP_Project_created}, Converter={StaticResource LocalizeXAMLConverter}}">
            <ContentPresenter.Style>
                <Style>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding ShowHelp_CreateProject}" Value="False">
                            <Setter Property="ContentPresenter.Visibility" Value="Collapsed"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </ContentPresenter.Style>
        </ContentPresenter>
        
        <StackPanel.Style>
            <Style>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ElementName=okiGotItButton, Path=IsChecked}" Value="True">
                        <Setter Property="ContentPresenter.Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </StackPanel.Style>
        
    </StackPanel>

        <ToggleButton x:Name="okiGotItButton" Margin="2,0,0,8">
            <ToggleButton.Template>
                <ControlTemplate>
                    <TextBlock x:Name="textBlockHelp" Text="{x:Static props:Resources.ok_i_know}" Style="{StaticResource HyperLinkTextBlock}"/>
                    <ControlTemplate.Triggers>
                        <Trigger Property="ToggleButton.IsChecked" Value="True">
                            <Setter TargetName="textBlockHelp" Property="Text" Value="{x:Static props:Resources.need_help}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </ToggleButton.Template>                        
        </ToggleButton>
        
        <StackPanel.Style>
            <Style>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsThereAnyHelp}" Value="True">
                        <Setter Property="StackPanel.Visibility" Value="Visible"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsThereAnyHelp}" Value="False">
                        <Setter Property="StackPanel.Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </StackPanel.Style>
    </StackPanel>
</UserControl>
